home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-16 | 2.4 KB | 50 lines | [TEXT/CCL2] |
- The file applescript.lisp defines some classes and methods for running
- applescript scripts from Lisp. In order to make this magic happen you need to
- add the file OSA.LISP to ccl:library;interfaces; and then call (reindex-interfaces).
-
- There is a loader file called applescript-loader.lisp. It will expect to find
- the files AEStuff, AppleScript, Utils and AppleScript editor, in the folder
- ccl:applescript/appleevents;. I assume that you have the files "appleevent-toolkit",
- "scrolling-fred-dialog-item" and "scrollers" which are all part of MCL and that
- they are accessible when called by require.
-
-
- Note that this stuff is still under construction and there may be memory
- problems. I haven't done all the error handling and cleanup that I want but the
- code is still quite functional. There is an example at the end of
- applescript.lisp which illustrates how to create an applescript instance,
- compile and run the script.
-
- The file called applescript-editor.lisp contains defs for a little applescript
- editor window. Please note that if you call edit-script on an applescript
- instance, any script in the script slot will be shown in the editor. If you put
- the script into the object when you create the object, you need to put in the
- escape character \ before anything which is quoted within the script string.
- You do not do this in the applescript editor. E.g.,
-
- (setf testObj (make-instance 'as::applescript-object
- :script "Tell application \"Eudora\" to reply message 4 of mailbox \"in\" of mail folder \"\""
- :application-name "Eudora"))
-
- whereas in the editor you would simply write:
-
- Tell application "Eudora" to reply message 4 of mailbox "in" of mail folder ""
-
-
- the "Show the Result" check box just directs the result (whatever that may be) to the lisp listener
- Note that the value of the result of sending the script is always stored in the returned.value
- slot of the applescript instance (accessor is returned-value)
-
- I have also added recording to the functionality on an applescript object.
- Example code is shown. Basically this allows you to create an applescript
- object with no script, turn recording on and have the script automatically get
- generated and stuffed into the applescript object. You can view the script
- also.
-
- There is lots left to do and implement - think of all this as a framework for
- using applescript from lisp.
-
- Please send comments to me (bonura@apple.com). Enjoy.
-
- Tom Bonura
- Apple Computer, Inc.